<template>
	<view id="wrap">
		<canvas canvas-id="qr-code" class="canvas"></canvas>
		<!-- <c-poster :width="100" :height="100" ref="poster" @ready="handleReady"></c-poster> -->
	</view>
</template>

<script>
		import {
			qrcodeCanvas
		} from "@/components/qrcode";
	export default {
		data() {
			return {
				
			};
		},
		methods: {
			// 生成二维码
			async initQrCode(text) {
				await qrcodeCanvas("qr-code", text, 0, 0, 320, 320, this);
			},
		},
		onShow() {
			this.initQrCode('https://www.baidu.com/')
		}
	}
</script>

<style lang="scss" scoped>
	#wrap {
		padding: 20rpx;
	}
</style>
